package com.zhike.controller;

import com.zhike.service.DwsTripBtWindowService;
import com.zhike.service.DwsTripWindowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: zhike
 * @CreateTime: 2024/4/30 14:23
 * @Description: 行驶主题的controller
 */
@RestController
@RequestMapping("trip")
public class TripTodayController {
    @Autowired
    private DwsTripWindowService dwsTripWindowService;

    @Autowired
    private DwsTripBtWindowService dwsTripBtWindowService;


    /**
     * 获取当日每辆车的平均速度最快的5辆车
     */
    @PostMapping("getAvgSpeedToday")
    public String getAvgSpeedToday(@RequestBody String filter){
        return dwsTripWindowService.getAvgSpeedToday(filter);
    }

    /**
     * 获取当日每辆车行驶里程最长的5辆车
     */
    @PostMapping("getMileageToday")
    public String getMileageToday(@RequestBody String filter){
        return dwsTripWindowService.getMileageToday(filter);
    }

    /**
     * 获取当日每辆车平均百公里急加减次数
     */
    @PostMapping("getNumToday")
    public String getNumToday(@RequestBody String filter){
        return dwsTripWindowService.getNumToday(filter);
    }

    /**
     * 获取当日每种车型平均速度
     */
    @PostMapping("getAvgTypeToday")
    public String getAvgTypeToday(@RequestBody String filter){
        return dwsTripBtWindowService.getAvgTypeToday(filter);
    }

    /**
     * 获取当日每种车型的急加减次数
     */
    @PostMapping("getCountTypeToday")
    public String getCountTypeToday(@RequestBody String filter){
        return dwsTripBtWindowService.getCountTypeToday(filter);
    }

    /**
     * 获取当日每种品牌平均速度
     */
    @PostMapping("getAvgBrandToday")
    public String getAvgBrandToday(@RequestBody String filter){
        return dwsTripBtWindowService.getAvgBrandToday(filter);
    }

    /**
     * 获取当日每种品牌的急加减次数
     */
    @PostMapping("getCountBrandToday")
    public String getCountBrandToday(@RequestBody String filter){
        return dwsTripBtWindowService.getCountBrandToday(filter);
    }

}
